package cn.tedu.mapper;

import cn.tedu.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    public List<User> findAll();

    void changeState(@Param("state") int state, @Param("userIds")String[] userIds);

    void delete(String[] userIds);

    void saveUser(User user);

    User findOneById(String userId);

    void update(User user);

    @Delete("delete from role_user_p where user_id = #{userId}")
    void deleteRolesByUserId(String userId);

    @Insert("insert into role_user_p values (#{roleId},#{userId})")
    void saveUserRole(@Param("userId")String userId, @Param("roleId")String roleId);
}
